import Vue from 'vue'
import App from './App.vue'
import { router } from './router'
import store from './store'
import 'amfe-flexible'
import { NavBar, Form, Field, Button, Tabbar, TabbarItem, Icon, Tab, Tabs, List, Cell, PullRefresh, ActionSheet, Dialog } from 'vant'

Vue.use(Cell)
Vue.use(Dialog)
Vue.use(List)
Vue.use(NavBar)

Vue.config.productionTip = false

Vue.use(Form)
Vue.use(Field)

Vue.use(Button)

Vue.use(Tabbar)
Vue.use(TabbarItem)

Vue.use(Icon)

Vue.use(Tab)
Vue.use(Tabs)

Vue.use(PullRefresh)

Vue.use(ActionSheet)

// 自动聚焦
Vue.directive('focus', {
  inserted (el) {
    el.querySelector('.van-field__control').focus()
    console.log(el)
  }
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
